<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich"
	template="layout/template.xhtml">
	<ui:define name="body">
		<h:form id="registrationForm">
			<rich:panel>
				<f:facet name="header">
					<h:outputText value="#{messages['login.tag.register']}" />
				</f:facet>
				<div class="dialog">
					<h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value">
						<h:outputLabel for="username" value="#{messages['login.tag.username']}" />
						<s:div>
							<h:inputText label="#{messages['login.tag.username']}" id="username"
								value="#{registrationBackBean.newUser.userName}" required="true"
								title="#{messages['login.tag.username']}" />
							<rich:message for="username">
								<f:facet name="errorMarker">
									<h:graphicImage value="/img/msgerror.png" />
								</f:facet>
							</rich:message>
						</s:div>

						<h:outputLabel for="password" value="#{messages['login.tag.password']}" />
						<s:div>
							<h:inputSecret label="#{messages['login.tag.password']}" id="password"
								title="#{messages['login.tag.password']}" value="#{registrationBackBean.newUser.password}"
								required="true" redisplay="true" />
							<rich:message for="password">
								<f:facet name="errorMarker">
									<h:graphicImage value="/img/msgerror.png" />
								</f:facet>
							</rich:message>
						</s:div>

						<h:outputLabel for="conf_password" value="#{messages['login.tag.confirmpassword']}" />
						<s:div>
							<h:inputSecret label="#{messages['login.tag.confirmpassword']}" id="conf_password"
								required="true" title="#{messages['login.tag.confirmpassword']}">
								<s:validateEquality message="Password must be identical" for="password" />
							</h:inputSecret>
							<rich:message for="conf_password">
								<f:facet name="errorMarker">
									<h:graphicImage value="/img/msgerror.png" />
								</f:facet>
							</rich:message>
						</s:div>

						<h:outputLabel for="firstName" value="#{messages['login.tag.firstname']}" />
						<h:inputText id="firstName" value="#{registrationBackBean.newUser.firstName}"
							title="#{messages['login.tag.firstname']}" />
						<h:outputLabel for="lastName" value="#{messages['login.tag.lastname']}" />
						<h:inputText id="lastName" value="#{registrationBackBean.newUser.lastName}"
							title="#{messages['login.tag.lastname']}" />
						<h:outputLabel for="email" value="#{messages['login.tag.email']}" />
						<h:inputText id="email" value="#{registrationBackBean.newUser.eMail}"
							title="#{messages['login.tag.email']}" />
						<h:outputLabel for="tel" value="#{messages['login.tag.tel']}" />
						<h:inputText id="tel" value="#{registrationBackBean.newUser.tel}"
							title="#{messages['login.tag.tel']}" />
					</h:panelGrid>
				</div>
			</rich:panel>
			<div class="actionButtons">
				<h:commandButton id="submit" value="#{messages['login.tag.register']}"
					action="#{registrationBackBean.saveNewUser()}" />
				<s:button id="home" value="#{messages['menu.tag.home']}" action="home" />
			</div>
		</h:form>
		<script type="text/javascript">
			document.getElementById("registrationForm:username").focus();
		</script>
	</ui:define>
</ui:composition>
